package com.homedo.odin.solution.controller.pc;

import com.homedo.core.common.base.dto.Meta;
import com.homedo.core.common.base.dto.ResultData;
import com.homedo.odin.solution.enumcode.basic.DeleteEnum;
import com.homedo.odin.solution.enumcode.basic.IsUseEnum;
import com.homedo.odin.solution.model.entity.ColumnTag;
import com.homedo.odin.solution.service.ColumnTagServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: donglibing
 * @date: 2018/3/6 14:39
 * @Description:
 */
@Api(description = "标签", tags = {"ColumnTag"}, produces = MediaType.APPLICATION_JSON_VALUE)
@RestController
@RequestMapping("/tags")
public class ColumnTagController {

    @Autowired
    private ColumnTagServiceImpl columnTagService;

    @GetMapping
    @ApiOperation(value = "PC_获取所有标签列表", response = ColumnTag.class, httpMethod = "GET")
    public ResultData queryAllTag() {
        List<ColumnTag> result = columnTagService
                .queryAllTag(IsUseEnum.YES.getDbValue(), DeleteEnum.NOT_DEL.getDbValue());
        return ResultData.newInstance(Meta.CODE_200, result);
    }
}
